package com.yesep.learn.design.behavioral.memento;

/**
 * 发起者
 */
public class Originator {
    private String content;

    public Originator(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public IMemento save() {
        return new Memento(content);
    }

    public void restore(IMemento memento) {
        content = memento.getContent();
    }
}
